Mysql modifier bitsCN.com
Mysql modifier
Not null
If not null is used for modification, when the default value is added to the table:
The value type is 0.
The string type is null.
If the data type is timestamp, the default value is the current
The role of the data type:1. Specifying the type of value2. Specify the space occupied3. Fixed length (fixed-length) or variable length (variable-length)4.mysql How to compare and sort the types of values5. Whether the defined type can be
Common functions used to query time periods using MySQL timestamps
Unix_timestamp (date)
If no parameter is called, a Unix timestamp (in seconds starting from '2017-01-01 00:00:00 'GMT) is returned ). If unix_timestamp () is called with a date
The formula for using execl to convert the timestamp is: Code :( xxxxxxxxxx + 8*3600) 86400 + 70*365 + 19 use statements to explain the timestamp syntax example: Code: selectfrom_unixtime (1234567890, % y-% m-% d % h: % I: % s) attached: in mysql,
This article introduces two tips: how mysql converts a timestamp to a common time format and how MySql queries the current database time.
(1) run the following command to query the current time of a database in MySql:
Select now (); // return format:
The formula for using execl to convert the timestamp is:
Code:
= (Xxxxxxxxxx + 8*3600)/86400 + 70*365 + 19
Use the mysql tutorial statement to explain the timestamp syntax example:
Code:
Select from_unixtime (1234567890, '% y-% m-% d % h: % I: % s ')
Mysql timestamp is converted into two common readable time formats. For more information, see.
Mysql timestamp is converted into two common readable time formats. For more information, see.
The formula is:Code:
Syntax example:
Code:
Appendix:In
SQLite database processing time problem and date time functionfirst of all, the SQLite database in time processing and SQL Server also has a different oracle, the following according to their own examples summarized. A log data table was
Data Types supported by Mysql (Summary of column types) and mysql Data Types
I. Numerical type
Mysql supports all numeric types in standard SQL, including strict data types (INTEGER, SMALLINT, DECIMAL, NUMBERIC), and approximate numeric data types
A. Numeric type
MySQL supports numeric types in all standard SQL, including strict data types (integer,smallint,decimal,numberic), and approximate numeric data types (float,real,double presision). And on this basis to expand.
After the expansion,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.